<!DOCTYPE html>
<html lang="en">
<head>
    <title></title>
</head>
<body>
<a href="login.php">返回</a>
</body>
</html>
<?php
include'conn.php';
session_start();
$_SESSION['user.account']='';
if($conn){
    //echo"连接成功";
    $result=mysqli_query($conn,"select *from user;");
    if(isset($_POST['account'])&&isset($_POST['password'])){
        $user=$_POST['account'];
        $pass=$_POST['password'];
        $bool=false;
        while($r=mysqli_fetch_object($result)){
            if( $r->account==$user&&$r->password==$pass){
                $_SESSION['user.account']=1;
                $bool=true;
                header('Location:index.php');
            }
        }
        if(!$bool){
            echo'<script type="text/javascript">
                window.alert("账号或密码不一致");
            </script>';
        }
    }
}

